//
//  ZViewController.h
//  ZPlayer
//
//  Created by Zed Link on 26/11/2016.
//  Copyright © 2016 ZED. All rights reserved.
//
//  视图控制器基类

#import <UIKit/UIKit.h>
#import <Masonry.h>
#import "MBProgressHUD+ZUtilities.h"
#import "UILabel+ZUtilities.h"
#import "UIImage+ZUtilities.h"
#import "UIView+ZUtilities.h"
#import "UIButton+ZUtilities.h"
#import "UIImageView+ZUtilities.h"
#import "NSString+ZUtilities.h"


@interface ZBaseViewController : UIViewController

/**
 子类通过IB加载或纯代码加载时, 可重写该方法, 并返回对应的实例对象
 默认返回 -alloc, -init 两个方法创建的实例
 */
+ (instancetype)zNew;

/**
 从Storyboard加载与类同名的实例
 */
+ (instancetype)zStoryboardInstance;


+ (instancetype)zStoryboardInstanceWithStoryboardName:(NSString *)sbName;
/**
 添加导航栏返回按钮
 @param gestureSupport 手势返回支持
 */
- (void)zAddBackItemWithGesture:(BOOL)gestureSupport;
- (void)zAddWhiteBackItemWithGesture:(BOOL)gestureSupport;
/**
 返回图片对应的NavigationItem
 */
- (UIBarButtonItem *)zNavItemWithImage:(NSString *)imageName shouldOriginal:(BOOL)original andSelector:(SEL)selector;

/**
 返回纯文本的NavigationItem
 */
- (UIBarButtonItem *)zNavItemWithTitle:(NSString *)title andSelector:(SEL)selector;

/**
 导航控制器pop操作
 */
- (void)zPopBack;

/**
 导航栏背景透明处理
 @param hasSeparator 是否需要导航栏底部分割线
 */
- (void)zClearNavBgColorAndSeparator:(BOOL)hasSeparator;

/**
 导航栏背景视图, 配合导航栏背景透明使用
 */
@property (strong, nonatomic) UIImageView *navBgView;

/**
 导航栏背景分割线, 配合navBgView使用
 */
@property (strong, nonatomic) UIImageView *navSeparatorLine;

/**
 设置导航栏前景色
 */
- (void)zSetNavigationForceColor:(UIColor *)color;

/**
 统一: 导航栏配置
 */
- (void)zConfigNavigation;

/**
 统一: 子视图加载
 */
- (void)zLoadSubview;

@end
